<?php
	class LoginView
	{
		private $getUserName = "userName";
		private $getPassword = "password";
		private $getLoginButton = "loginButton";
		private $getLogoutButton = "logoutButton";
		
		public function DoLoginBox()
		{
			 $loginBox = "<form name='login' id='login' method='get'>
	      					<div>
					       		<p>Namn:</p>  
					    		<input type='text' name='$this->getUserName' id='userName' />
					    		<p>Lösenord:</p>    
					    		<input type='password' name='$this->getPassword' id='password' />
					    	</div>
				    		<div>
				      			<input type='submit' value='Logga in' name='$this->getLoginButton' id='loginButton' />
				      		</div>
     
     					</form>";
			return $loginBox;
		}
		
		public function DoLogoutBox()
		{
			$logoutBox = "<form name='login' id='login' method='get'>
  							<div>
			      				<input type='submit' value='Logga ut' name='$this->getLogoutButton' id='logoutButton' />
     						</div>
     					</form>";
			return $logoutBox;	
		}
		
		public function GetUserName()
		{
			if ($_GET[$this->getUserName] != "")
			{
				return $_GET[$this->getUserName];
			}
			else 
			{
				return null;		
			}
		}
		public function GetPassword()
		{
			if ($_GET[$this->getPassword] != "")
			{
				return $_GET[$this->getPassword];
			}
			else 
			{
				return null;		
			}
		}
		
		public function TriedToLogin()
		{
			if (isset ($_GET[$this->getLoginButton]))
			{
				return true;
			}
			else 
			{
				return false;		
			}
		}
		
		public function TriedToLogout()
		{
			if (isset ($_GET[$this->getLogoutButton]))
			{
				return true;
			}
			else 
			{
				return false;		
			}
		}
	}
?>